home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Format CD 46
/
Amiga Format CD46 (1999-10-20)(Future Publishing)(GB)[!][issue 1999-12].iso
/
-in_the_mag-
/
reader_requests
/
scilab
/
demos
/
signal
/
bode.dem
next >
Wrap
Text File
|
1999-09-16
|
1KB
|
45 lines
//////////////////
//BODE PLOTS//////
//////////////////
//First plot using state space representation
//
// xd=-2*%pi*x+u
// y=18*%pi*x+u
//
// h(s)=18*%pi/(s+2*%pi)
//
a=-2*%pi;
b=1;
c=18*%pi;
d=1;
sl=syslin('c',a,b,c,d);ssprint(sl)
bode(sl,.1,100),
halt()
cw=xget("window");if cw>=1 then;ccw=cw-1;else ccw=cw+1;end
xbasc(cw); xbasc(ccw);
//Second plot using poly
s=poly(0,'s');
h1=1/real((s+2*%pi*(15+100*%i))*(s+2*%pi*(15-100*%i)));
h1=syslin('c',h1)
bode(h1,10,1000,.01),
halt()
cw=xget("window");if cw>=1 then;ccw=cw-1;else ccw=cw+1;end
xbasc(cw); xbasc(ccw);
//Third plot which combines the first two plots
bode([h1;sl],.1,1000,.01);
halt()
cw=xget("window");if cw>=1 then;ccw=cw-1;else ccw=cw+1;end
xbasc(cw); xbasc(ccw);
// series connection
bode(h1*sl,.1,1000,.01);
halt()
cw=xget("window");if cw>=1 then;ccw=cw-1;else ccw=cw+1;end
xbasc(cw); xbasc(ccw);